package park;

import java.util.Scanner;

public class J12Retangle {
	
	public static void main(String[] args){
		
		red red = new red();
		red.getArea();
		red.getPerimeter();
		orange orange = new orange();
		orange.getArea();
		orange.getPerimeter();
		
		
		
		
		
		 
	}

}

class red{
	
	double width;
	double height;
	double getArea;
	double getPerimeter;
	
	public double getArea(){
		
		System.out.println("사각형 넓이 계산기에 오신걸 환영합니다");
		Scanner sc = new Scanner(System.in);
		
		System.out.println("사각형 넓이 가로값 입력해주세요");
		width = sc.nextDouble();
		
		System.out.println("사각형 넓이 세로값 입력해주세요");
		height = sc.nextDouble();
		
		sc.close();
		
		System.out.println("사각형 넓이는" + getArea + "입니다" );
		
		
		
		return (width * height);
		
}
	
	
	public double getPerimeter(){
		
		System.out.println("사각형 둘레 계산기에 오신걸 환영합니다");
		Scanner sc = new Scanner(System.in);
		
		width = sc.nextDouble();
		height = sc.nextDouble();
		
		System.out.println("사각형 둘레는" + getPerimeter + "입니다" );
		
		return (width + height) * 2;
	

	}

}

class orange{
	
	double width;
	double height;
	double getArea;
	double getPerimeter;

	
	public double getArea(){
		
		Scanner sc = new Scanner(System.in);
		
		width = sc.nextDouble();
		height = sc.nextDouble();
		
		sc.close();
		
		return (width * height);
		
}
	
	
	public double getPerimeter(){
		
		Scanner sc = new Scanner(System.in);
		
		width = sc.nextDouble();
		height = sc.nextDouble();
	
		return (width + height) * 2;
	

	}
}

